package com.yiduo.outpost.core.web.interceptor;//package com.yiduo.outpost.autoconfigure.web.interceptor;
//
//import brave.Tracer;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.lang.Nullable;
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * @Author yanwen
// * @create 2021/12/30 1:58 PM
// * sleuth 响应携带 X-B3-TraceId 方便后续处理
// */
//@Slf4j
//public class TraceInterceptor implements HandlerInterceptor {
//    private Tracer tracer;
//
//    public TraceInterceptor(Tracer tracer) {
//        this.tracer = tracer;
//    }
//
//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable ModelAndView modelAndView) throws Exception {
//
//    }
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        response.addHeader("X-YIYE-TraceId", tracer.currentSpan().context().traceIdString());
//        return true;
//    }
//}
